package com.example.myapplication

import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import org.w3c.dom.Text

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // 获取按钮实例
        val button: Button = findViewById(R.id.button)
        val text: TextView = findViewById(R.id.textView)
        // 设置点击监听器
        button.setOnClickListener {
            button.text = getString(R.string.clicked)
            text.text = getString(R.string.hello_kotlin)
        }
    }
}